hysop.backend.host.host_array_backend module¶
- class hysop.backend.host.host_array_backend.HostArrayBackend(allocator, **kwds)[source]¶
Bases:
ArrayBackend
Host array backend.
Initialize an ArrayBackend with guven allocator.
- all(a, axis=None, out=None)[source]¶
Test whether all array elements along a given axis evaluate to True.
- allclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False)[source]¶
Returns True if two arrays are element-wise equal within a tolerance.
- any(a, axis=None, out=None)[source]¶
Test whether any array elements along a given axis evaluate to True.
- arange(*args, **kargs)[source]¶
Return evenly spaced values within a given interval. Data is not allocated from backend allocator.
- arctan2(x1, x2, out=None)[source]¶
Element-wise arc tangent of x1/x2 choosing the quadrant correctly.
- argpartition(a, kth, axis=-1, kind='quicksort', order=None)[source]¶
Perform an indirect partition along the given axis using the algorithm specified by the kind keyword.
- argsort(a, axis=-1, kind='quicksort', order=None)[source]¶
Returns the indices that would sort an array.
- array(shape, dtype=<class 'numpy.float64'>, order=C_CONTIGUOUS(0), min_alignment=None, buf=None, offset=0)[source]¶
Create a HostArray, see np.ndarray constructor. If buf is None, a new one is allocated from backend allocator.
- array2string(a, max_line_width=None, precision=None, suppress_small=None, separator=' ', prefix='', style=<built-in function repr>, formatter=None)[source]¶
Return a string representation of an array.
- array_equiv(a1, a2)[source]¶
returns True if input arrays are shape consistent and all elements equal.
- array_repr(arr, max_line_width=None, precision=None, supress_small=None)[source]¶
Return the string representation of an array.
- array_str(a, max_line_width=None, precision=None, suppress_small=None)[source]¶
Return a string representation of the data in an array.
- asanyarray(a, dtype=None, order=C_CONTIGUOUS(0))[source]¶
Convert the input to an ndarray, but pass ndarray subclasses through. Data is not allocated from backend allocator.
- asarray(a, dtype=None, order=C_CONTIGUOUS(0))[source]¶
Convert the input to an HostArray. Data is not allocated from backend allocator.
- asarray_chkfinite(a, dtype=None, order=C_CONTIGUOUS(0))[source]¶
Convert the input to an array, checking for NaNs or Infs.
- asmatrix(data, dtype=None)[source]¶
Interpret the input as a matrix. Data is not allocated from backend allocator.
- average(a, axis=None, weights=None, returned=False)[source]¶
Compute the weighted average along the specified axis.
- base_repr(number, base=2, padding=0)[source]¶
Return a string representation of a number in the given base system.
- binary_repr(num, width=None)[source]¶
Return the binary representation of the input number as a string.
- bincount(x, weights=None, minlength=None)[source]¶
Count number of occurrences of each value in array of non-negative ints.
- can_wrap(handle)[source]¶
Should return True if handle is an Array or a array handle corresponding this backend.
- choice(a, size=None, replace=True, p=None)[source]¶
Generates a random sample from a given 1-D array
- convolve(a, v, mode='full')[source]¶
Returns the discrete, linear convolution of two one-dimensional sequences.
- copyto(dst, src, reshape=False, queue=None, synchronize=True, **kwds)[source]¶
src is a HostArray dst can be everything
- cov(m, y=None, rowvar=True, bias=False, ddof=None, fweights=None, aweights=None)[source]¶
Estimate a covariance matrix, given data and weights.
- cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None)[source]¶
Return the cross product of two (arrays of) vectors.
- cumprod(a, axis=None, dtype=None, out=None)[source]¶
Return the cumulative product of elements along a given axis.
- cumsum(a, axis=None, dtype=None, out=None)[source]¶
Return the cumulative sum of the elements along a given axis.
- diag(v, k=0)[source]¶
Extract a diagonal or construct a diagonal array. Data is not allocated from backend allocator.
- diagflat(v, k=0)[source]¶
Create a two-dimensional array with the flattened input as a diagonal. Data is not allocated from backend allocator.
- digitize(x, bins, right=False)[source]¶
Return the indices of the bins to which each value in input array belongs.
- dsplit(ary, indices_or_sections)[source]¶
Split array into multiple sub-arrays along the 3rd axis (depth).
- ediff1d(ary, to_end=None, to_begin=None)[source]¶
The differences between consecutive elements of an array.
- eigh(a, UPLO='L')[source]¶
Return the eigenvalues and eigenvectors of a Hermitian or symmetric matrix.
- einsum(subscripts, out=None, dtype=None, order=SAME_ORDER(3), casting='safe', optimize=False, *operands)[source]¶
Evaluates the Einstein summation convention on the operands.
- empty(shape, dtype=<class 'numpy.float64'>, order=C_CONTIGUOUS(0), min_alignment=None)[source]¶
Return a new array of given shape and type, without initializing entries. Data is allocated from backend allocator.
- empty_like(a, dtype=None, order=None, subok=True, shape=None)[source]¶
Return a new array with the same shape and type as a given array. Data is allocated from backend allocator.
- eye(N, M, k, dtype=None)[source]¶
Return a 2-D array with ones on the diagonal and zeros elsewhere. Data is not allocated from backend allocator.
- fabs(x, out=None)[source]¶
Calculate the absolute value element-wise, outputs HYSOP_REAL unless out is set.
- fftn(a, s=None, axes=None, norm=None)[source]¶
Compute the N-dimensional discrete Fourier Transform.
- floor_divide(x1, x2, out=None)[source]¶
Return the largest integer smaller or equal to the division of the inputs.
- frexp(x, out1=None, out2=None)[source]¶
Decompose the elements of x into mantissa and twos exponent.
- frombuffer(afer, dtype=<class 'numpy.float64'>, count=-1, offset=0)[source]¶
Interpret a afer as a 1-dimensional array. Data is not allocated from backend allocator.
- fromfile(file, dtype=<class 'numpy.float64'>, count=-1, sep='')[source]¶
Construct an array from data in a text or binary file. Data is not allocated from backend allocator.
- fromfunction(function, shape, dtype=<class 'numpy.float64'>)[source]¶
Construct an array by executing a function over each coordinate. Data is not allocated from backend allocator.
- fromiter(iterable, dtype=<class 'numpy.float64'>, count=-1)[source]¶
Create a new 1-dimensional array from an iterable object. Data is not allocated from backend allocator.
- fromregex(file, regexp, dtype)[source]¶
Construct an array from a text file, using regular expression parsing.
- fromstring(string, dtype=<class 'numpy.float64'>, count=-1, sep='')[source]¶
A new 1-D array initialized from raw binary or text data in a string.
- full(shape, fill_value, dtype=<class 'numpy.float64'>, order=C_CONTIGUOUS(0), min_alignment=None)[source]¶
Return a new array of given shape and type, filled with fill_value. Data is allocated from backend allocator.
- full_like(a, fill_value, dtype=None, order=None, subok=True, shape=None)[source]¶
Return a new array with the same shape and type as a given array. Data is allocated from backend allocator.
- genfromtxt(fname, dtype=<class 'numpy.float64'>, comments='#', delimiter=None, skip_header=0, skip_footer=0, converters=None, missing_values=None, filling_values=None, usecols=None, names=None, excludelist=None, deletechars=None, replace_space='_', autostrip=False, case_sensitive=True, defaultfmt='f%i', unpack=None, usemask=False, loose=True, invalid_raise=True, max_rows=None)[source]¶
Load data from a text file, with missing values handled as specified.
- geomspace(start, stop, num=50, endpoint=True, dtype=<class 'numpy.float64'>)[source]¶
Return numbers spaced evenly on a log scale (a geometric progression). Data is not allocated from backend allocator.
- hfft(a, n=None, axis=-1, norm=None)[source]¶
Compute the FFT of a signal that has Hermitian symmetry, i.e., a real spectrum.
- histogram(a, bins=10, range=None, normed=False, weights=None, density=None)[source]¶
Compute the histogram of a set of data.
- histogram2d(x, y, bins, range=None, normed=False, weights=None)[source]¶
Compute the bi-dimensional histogram of two data samples.
- histogramdd(sample, bins, range=None, normed=False, weights=None)[source]¶
Compute the multidimensional histogram of some data.
- property host_array_backend¶
- hsplit(ary, indices_or_sections)[source]¶
Split an array into multiple sub-arrays horizontally (column-wise).
- hypergeometric(ngood, nbad, nsample, size=None)[source]¶
Draw samples from a Hypergeometric distribution.
- identity(n, dtype=None)[source]¶
Return the identity array. Data is not allocated from backend allocator.
- ifft(a, n=None, axis=-1, norm=None)[source]¶
Compute the one-dimensional inverse discrete Fourier Transform.
- ifft2(a, s=None, axes=None, norm=None)[source]¶
Compute the 2-dimensional inverse discrete Fourier Transform.
- ifftn(a, s=None, axes=None, norm=None)[source]¶
Compute the N-dimensional inverse discrete Fourier Transform.
- ihfft(a, n=None, axis=-1, norm=None)[source]¶
Compute the inverse FFT of a signal that has Hermitian symmetry.
- in1d(ar1, ar2, assume_unique=False, invert=False)[source]¶
Test whether each element of a 1-D array is also present in a second array.
- insert(arr, obj, values, axis=None)[source]¶
Insert values along the given axis before the given indices.
- interp(x, xp, fp, left=None, right=None, period=None)[source]¶
One-dimensional linear interpolation.
- irfft(a, n=None, axis=-1, norm=None)[source]¶
Compute the inverse of the n-point DFT for real input.
- irfft2(a, s=None, axes=(-2, -1), norm=None)[source]¶
Compute the 2-dimensional inverse FFT of a real array.
- irfftn(a, s=None, axes=None, norm=None)[source]¶
Compute the inverse of the N-dimensional FFT of real input.
- isclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False)[source]¶
Returns a boolean array where two arrays are element-wise equal within a tolerance.
- isneginf(x, out=None)[source]¶
Test element-wise for negative infinity, return result as bool array.
- isposinf(x, out=None)[source]¶
Test element-wise for positive infinity, return result as bool array.
- property kind¶
- laplace(loc=0.0, scale=1.0, size=None)[source]¶
Draw samples from the Laplace or double exponential distribution with specified location (or mean=0.0) and scale (decay).
- linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=<class 'numpy.float64'>)[source]¶
Return evenly spaced numbers over a specified interval. Data is not allocated from backend allocator.
- load(mmap_mode=None, allow_pickle=True, fix_imports=True, encoding='ASCII')[source]¶
Load arrays or pickled objects from .npy, .npz or pickled files.
- loadtxt(dtype=<class 'numpy.float64'>, comments='#', delimiter=None, converters=None, skiprows=0, usecols=None, unpack=False, ndmin=0)[source]¶
Load data from a text file.
- logaddexp2(x1, x2, out=None)[source]¶
Logarithm of the sum of exponentiations of the inputs in base-2.
- logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=<class 'numpy.float64'>)[source]¶
Return numbers spaced evenly on a log scale. Data is not allocated from backend allocator.
- mean(a, axis=None, dtype=None, out=None)[source]¶
Compute the arithmetic mean along the specified axis.
- median(a, axis=None, out=None, overwrite_input=False)[source]¶
Compute the median along the specified axis.
- meshgrid(*xi, **kwargs)[source]¶
Return coordinate matrices from coordinate vectors. Data is not allocated from backend allocator.
- modf(x, out1=None, out2=None)[source]¶
Return the fractional and integral parts of an array, element-wise.
- multivariate_normal(mean, cov, size=None)[source]¶
Draw random samples from a multivariate normal distribution.
- nanargmax(a, axis=None)[source]¶
Return the indices of the maximum values in the specified axis ignoring NaNs.
- nanargmin(a, axis=None)[source]¶
Return the indices of the minimum values in the specified axis ignoring NaNs.
- nancumprod(a, axis=None, dtype=None, out=None)[source]¶
Return the cumulative product of array elements over a given axis treating Not a Numbers (NaNs) as one.
- nancumsum(a, axis=None, dtype=None, out=None)[source]¶
Return the cumulative sum of array elements over a given axis treating Not a Numbers (NaNs) as zero.
- nanmax(a, axis=None, out=None)[source]¶
Return the maximum of an array or maximum along an axis, ignoring any NaNs.
- nanmean(a, axis=None, dtype=None, out=None)[source]¶
Compute the arithmetic mean along the specified axis, ignoring NaNs.
- nanmedian(a, axis=None, out=None, overwrite_input=False)[source]¶
Compute the median along the specified axis, while ignoring NaNs.
- nanmin(a, axis=None, out=None)[source]¶
Return minimum of an array or minimum along an axis, ignoring any NaNs.
- nanpercentile(a, q, axis=None, out=None, overwrite_input=False, interpolation='linear')[source]¶
Compute the qth percentile of the data along the specified axis, while ignoring nan values.
- nanprod(a, axis=None, dtype=None, out=None)[source]¶
Return the product of array elements over a given axis treating Not a Numbers (NaNs) as ones.
- nanstd(a, axis=None, dtype=None, out=None, ddof=0)[source]¶
Compute the standard deviation along the specified axis, while ignoring NaNs.
- nansum(a, axis=None, dtype=None, out=None)[source]¶
Return the sum of array elements over a given axis treating Not a Numbers (NaNs) as zero.
- nanvar(a, axis=None, dtype=None, out=None, ddof=0)[source]¶
Compute the variance along the specified axis, while ignoring NaNs.
- noncentral_chisquare(df, nonc, size=None)[source]¶
Draw samples from a noncentral chi-square distribution.
- noncentral_f(dfnum, dfden, nonc, size=None)[source]¶
Draw samples from the noncentral F distribution.
- normal(loc=0.0, scale=1.0, size=None)[source]¶
Draw random samples from a normal (Gaussian) distribution.
- ones(shape, dtype=<class 'numpy.float64'>, order=C_CONTIGUOUS(0), min_alignment=None)[source]¶
Return a new array of given shape and type, filled with ones. Data is allocated from backend allocator.
- ones_like(a, dtype=None, order=None, subok=True, shape=None)[source]¶
Return an array of ones with the same shape and type as a given array. Data is allocated from backend allocator.
- packbits(myarray, axis=None)[source]¶
Packs the elements of a binary-valued array into bits in a uint8 array.
- pareto(a, size=None)[source]¶
Draw samples from a Pareto II or Lomax distribution with specified shape.
- partition(a, kth, axis=-1, kind='quicksort', order=None)[source]¶
Return a partitioned copy of an array.
- percentile(a, q, axis=None, out=None, overwrite_input=False, interpolation='linear')[source]¶
Compute the qth percentile of the data along the specified axis.
- power(a, size=None)[source]¶
Draws samples in 0, 1 from a power distribution with positive exponent a - 1.
- prod(a, axis=None, dtype=None, out=None)[source]¶
Return the product of array elements over a given axis.
- randint(low, high=None, size=None, dtype=<class 'numpy.int32'>)[source]¶
Return random integers from low (inclusive) to high (exclusive).
- random_integers(low, high=None, size=None)[source]¶
Random integers of type np.int between low and high, inclusive.
- real_if_close(a, tol=100)[source]¶
If complex input returns a real array if complex parts are close to zero.
- require(a, dtype=None, requirements=None)[source]¶
Return an ndarray of the provided type that satisfies requirements.
- reshape(a, newshape, order=C_CONTIGUOUS(0))[source]¶
Gives a new shape to an array without changing its data.
- rfft(a, n=None, axis=-1, norm=None)[source]¶
Compute the one-dimensional discrete Fourier Transform for real input.
- rfftfreq(n=None, d=1.0)[source]¶
Return the Discrete Fourier Transform sample frequencies (for usage with rfft, irfft).
- rfftn(a, s=None, axes=None, norm=None)[source]¶
Compute the N-dimensional discrete Fourier Transform for real input.
- rollaxis(a, axis, start=0)[source]¶
Roll the specified axis backwards, until it lies in a given position.
- save(arr, file, allow_pickle=True, fix_imports=True)[source]¶
Save an array to a binary file in NumPy .npy format.
- savetxt(fname, X, fmt='%.18e', delimiter=' ', newline='\n', header='', footer='', comments='# ')[source]¶
Save an array to a text file.
- savez(file, *args, **kwds)[source]¶
Save several arrays into a single file in uncompressed .npz format.
- savez_compressed(file, *args, **kwds)[source]¶
Save several arrays into a single file in compressed .npz format.
- searchsorted(a, v, side='left', sorter=None)[source]¶
Find indices where elements should be inserted to maintain order.
- set_printoptions(precision=None, threshold=None, edgeitems=None, linewidth=None, suppress=None, nanstr=None, infstr=None, formatter=None)[source]¶
Set printing options.
- set_string_function(f, repr=True)[source]¶
Set a Python function to be used when pretty printing arrays.
- standard_normal(size=None)[source]¶
Draw samples from a standard Normal distribution (mean=0.0, stdev=1).
- standard_t(df, size=None)[source]¶
Draw samples from a standard Student’s t distribution with df degrees of freedom.
- std(a, axis=None, dtype=None, out=None, ddof=0)[source]¶
Compute the standard deviation along the specified axis.
- trace(a, offset=0, axis1=0, axis2=1, dtype=None, out=None)[source]¶
Return the sum along diagonals of the array.
- trapz(y, x=None, dx=1.0, axis=-1)[source]¶
Integrate along the given axis using the composite trapezoidal rule.
- tri(N, M=None, k=0, dtype=<class 'numpy.float64'>)[source]¶
An array with ones at and below the given diagonal and zeros elsewhere. Data is not allocated from backend allocator.
- triangular(left, mode, right, size=None)[source]¶
Draw samples from the triangular distribution over the interval left, right.
- trim_zeros(filt, trim='fb')[source]¶
Trim the leading and/or trailing zeros from a 1-D array or sequence.
- unique(ar, return_index=False, return_inverse=False, return_counts=False)[source]¶
Find the unique elements of an array.
- unpackbits(myarray, axis=None)[source]¶
Unpacks elements of a uint8 array into a binary-valued output array.
- unwrap(p, discont=3.141592653589793, axis=-1)[source]¶
Unwrap by changing deltas between values to 2*pi complement.
- vander(x, N=None, increasing=False)[source]¶
Generate a Vandermonde matrix. Data is not allocated from backend allocator.
- var(a, axis=None, dtype=None, out=None, ddof=0)[source]¶
Compute the variance along the specified axis.
- vectorize(pyfunc, otypes=None, doc=None, excluded=None, cache=False, signature=None)[source]¶
Generalized function class.
- vsplit(ary, indices_or_sections)[source]¶
Split an array into multiple sub-arrays vertically (row-wise).
- wald(mean=0.0, scale=1.0, size=None)[source]¶
Draw samples from a Wald, or inverse Gaussian, distribution.
- zeros(shape, dtype=<class 'numpy.float64'>, order=C_CONTIGUOUS(0), min_alignment=None)[source]¶
Return a new array of given shape and type, filled with zeros. Data is allocated from backend allocator.